#ifndef ASIO_SERVER_SERVER_H
#define ASIO_SERVER_SERVER_H

#include <map>

#include "Session.h"
#include "IOServicePool.h"

class Server {
public:
    Server(io_context &ioContext, short port);

    void ClearSession(const string &uuid);

private:
    void StartAccept();

    void HandleAccept(const shared_ptr<Session> &session, const boost::system::error_code &ec);

private:
    io_context &_ioc;
    tcp::acceptor _acceptor;
    map<string, shared_ptr<Session> > _session_map;
};


#endif //ASIO_SERVER_SERVER_H
